set(CALC_SOURCE_FILES
  main.cpp
  MathOperationDataModel.cpp
  NumberDisplayDataModel.cpp
  NumberSourceDataModel.cpp
)

set(CALC_HEADER_FILES
  AdditionModel.hpp
  DivisionModel.hpp
  DecimalData.hpp
  MathOperationDataModel.hpp
  NumberDisplayDataModel.hpp
  NumberSourceDataModel.hpp
  SubtractionModel.hpp
)
 find_package(Qt6 REQUIRED COMPONENTS OpenGLWidgets)

add_executable(calculator
  ${CALC_SOURCE_FILES}
  ${CALC_HEAEDR_FILES}
)

target_link_libraries(calculator QtNodes Qt6::OpenGLWidgets)



set(HEADLESS_CALC_SOURCE_FILES
  headless_main.cpp
  MathOperationDataModel.cpp
  NumberDisplayDataModel.cpp
  NumberSourceDataModel.cpp
)

add_executable(headless_calculator 
  ${HEADLESS_CALC_SOURCE_FILES}
  ${CALC_HEAEDR_FILES}
)

target_link_libraries(headless_calculator QtNodes Qt6::OpenGLWidgets)

# 添加 Windows DLL 自动部署
if(WIN32)
    add_custom_command(TARGET headless_calculator POST_BUILD
        COMMAND "${CMAKE_PREFIX_PATH}/bin/windeployqt.exe" 
            "$<TARGET_FILE:headless_calculator>"
        COMMENT "Deploying Qt runtime dependencies..."
    )
endif()
